home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple II Magazines (PO)
/
Nibble Volume 09, No. 12 (1988-12)(MicroSPARC)(Side A)[a].zip
/
Nibble Volume 09, No. 12 (1988-12)(MicroSPARC)(Side A)[a].po
/
TEXT.SHIFTER.S
< prev
Wrap
Text File
|
1996-12-24
|
1KB
|
39 lines
*
* TEXT.SHIFTER Source Code
* By Steven Meuse
* Copyright(c) 1988
* MicroSPARC, Inc.
* Concord, MA 01742
*
T EQU 0
ORG $300
*
LDA $67 ;Get pointers to start of
STA T ;Applesoft program, and put
LDA $68 ;them into our temp pointer.
STA T+1
LDY #1 ;Is there a program in memory?
LDA (T),Y
BEQ DONE
CHECK LDY #4 ;4 is the offset to the first
GET LDA (T),Y ;byte of this line.
BEQ NEXTLINE ;If byte = 0, this line is done.
BMI NEXTBYTE ;If hi bit is on, this is a token.
CMP #$60 ;Check if text is lower case.
BCC NEXTBYTE ;No, get another byte.
AND #$5F ;Yes, shift it to upper case...
STA (T),Y ;...and put it back.
NEXTBYTE INY ;Point to next byte.
BNE GET ;Always taken.
NEXTLINE LDY #0 ;Get the pointers to the next line
LDA (T),Y ;and put them into temp pointer.
TAX
INY
LDA (T),Y ;This conditions the Z flag for
STA T+1 ;the BNE test below.
STX T
BNE CHECK ;A>0 if there are more lines
DONE RTS
CHK ;Merlin CHK code = 9D